
// Copyright (C) 2009-2011 Luca Piccioni
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//  
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//  
// You should have received a copy of the GNU General Public License
// along with this program.  If not, see <http://www.gnu.org/licenses/>.


using System;
using System.Diagnostics;

namespace Derm.Render
{
	/// <summary>
	/// Referenced resource interface.
	/// </summary>
	/// <remarks>
	/// <para>
	/// The main purpose of this interface is to define an uniform interface
	/// for referencing multiple time the same resource.
	/// </para>
	/// <para>
	/// Tipically a resource shall be release only when its reference count
	/// reach the value 0, indicating that no one is using this resource.
	/// </para>
	/// </remarks>
	public interface IReferenced
	{
		/// <summary>
		/// Increase the reference count of this object. 
		/// </summary>
		void Ref();
		
		/// <summary>
		/// Decrease the reference count of this object. 
		/// </summary>
		void Unref();
		
		/// <summary>
		/// Reference count for this object. 
		/// </summary>
		uint RefCount { get; }
	}
}
